import request from "@/libs/request";

const basePath = '/appcloud-resource' ;

export const apiUrls = {
	checkPort : basePath + '/api/resource/checkPort/',
  init : basePath + '/api/resource/init/',
  vncAuth : basePath + '/api/resource/vncAuth',
  vncConnection : basePath + '/api/resource/vncConnection',
}



//根据ip检查22端口是否能telnet
export async function checkPort(params){
	return request( apiUrls.checkPort, {
      method:'POST',
      body:params
  })
}

// 初始化资源
export async function init(params){
	return request( apiUrls.init, {
      method:'POST',
      body:params
  })
}


// wss vnc 授权
export async function vncAuth(ip){
	return request( apiUrls.vncAuth + '?' + 'ip' + '=' + ip , {
      method:'POST'
  })
}

//wss vnc 连接
export async function vncConnection(params){
	return request( apiUrls.vncConnection, {
      method:'POST',
      body:params
  })
}
